Module-level declarations

Types

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
struct plant_dto
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
struct seed_dto
Link copied to clipboard
Link copied to clipboard
entity seed_type
Link copied to clipboard
Link copied to clipboard
struct tool_dto

Properties

Link copied to clipboard
Link copied to clipboard
val log_prefix: text = "MNA_FARMING"
Link copied to clipboard

Functions

Link copied to clipboard
function _cleanup_user_seeds(account_id: byte_array, plot_id: integer)
Link copied to clipboard
Link copied to clipboard
function _remove_seed_ownership_on_plot(plot_id: integer, owners: list<seed_ownership>, seed_to_remove: farming_cell_dto)
Link copied to clipboard
function _reward_reverted_seeds_to_account(farming_cells: list<farming_cell_dto>, owner_account_id: byte_array)
Link copied to clipboard
function add_merged_crop_reward_produce(rewards: map<item, integer>, seed_type: seed_type)
Link copied to clipboard
function add_reward_for_singing(plant: plant_dto?, rewards: map<item, integer>, possible_seed_rewards: set<text>, action_index: integer)
Link copied to clipboard
function add_reward_produce(farming_cell_dto: farming_cell_dto, rewards: map<item, integer>, seed_type: seed_type, possible_seed_rewards: set<text>, action_index: integer)
Link copied to clipboard
function attempt_merge_for_cells(farming_cell_dto: farming_cell_dto, merge_candidates: merge_candidates, cells_map: map<location, farming_cell_dto>): boolean
Link copied to clipboard
function cache_transformations(farming_plot_action_dto: farming_plot_action_dto): (map<text, list<text>>, set<text>)
Link copied to clipboard
function check_heights_and_attempt_merge(plot: instance, cell: farming_cell_dto, cells_map: map<location, farming_cell_dto>, location: location, merge_candidates: merge_candidates): boolean
Link copied to clipboard
function check_not_duplicated_actions(farming_cell_action_dto: farming_cell_action_dto)
Link copied to clipboard
function check_sing_possibility(plot_id: integer, account_id: byte_array, locations: set<location>, current_time: integer)
Link copied to clipboard
function check_valid_next_cycle(plant_dto: plant_dto, timestamp: integer, action: text)
Link copied to clipboard
@extend(clear_grid_area) function clear_farmed_cells(cells_to_clear: set<location>, plot_id: integer)
Link copied to clipboard
Link copied to clipboard
function debug(msg: text)
Link copied to clipboard
function decrease_farming_tool_durability(account_id: byte_array, farming_cell_action_dto: farming_cell_action_dto, required_category: tool_category, durability_cost: integer)
Link copied to clipboard
function delete_and_update_seed_type(produce_id: text, growing_cycles: integer, harvest_amount: integer, fertility_extra_produce: integer, merged_crop_extra_produce: integer, planting_durability_cost: integer, watering_durability_cost: integer, harvesting_durability_cost: integer, time_per_growth_cycle: integer, seed: seed_type)
Link copied to clipboard
function figure_blocks(plot_id: integer, locations: list<location>): list<farming_block_dto>
Link copied to clipboard
function figure_merged_crops(plot_id: integer, just_planted_cells: list<location>, cells_map: map<location, farming_cell_dto>)
Link copied to clipboard
function figure_next_block(plot_id: integer, locations: list<location>): farming_block_dto
Link copied to clipboard
Link copied to clipboard
function get_fertility_chance(epoch_days: integer, plot_id: integer, location: location): integer
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
function get_seed_transformation(initial: text, transformations_map: map<text, list<text>>, action_index: integer): text
Link copied to clipboard
function harvest(farming_cell_dto: farming_cell_dto, cells_map: map<location, farming_cell_dto>, seed_type: seed_type, rewards: map<item, integer>, possible_seed_rewards: set<text>, action_index: integer)
Link copied to clipboard
function includes_category(farming_cell_action_dto: farming_cell_action_dto, category: tool_category): boolean
Link copied to clipboard
function includes_only_categories(farming_cell_action_dto: farming_cell_action_dto, categories: list<tool_category>): boolean
Link copied to clipboard
function includes_only_category(farming_cell_action_dto: farming_cell_action_dto, category: tool_category): boolean
Link copied to clipboard
function is_already_mature(plant_dto: plant_dto, seed_type: seed_type, timestamp: integer): boolean
Link copied to clipboard
function is_already_planted(farming_cell_dto: farming_cell_dto): boolean
Link copied to clipboard
function is_fertile(epoch_days: integer, plot_id: integer, fertility_rate: integer, location: location): boolean
Link copied to clipboard
Link copied to clipboard
function is_fertile_randomly(epoch_days: integer, plot_id: integer, fertility_rate: integer, location: location): boolean
Link copied to clipboard
function is_harvesting(farming_cell_action_dto: farming_cell_action_dto): boolean
Link copied to clipboard
function is_in_area(current_cell: location, cell: location, divided_area: integer): boolean
Link copied to clipboard
function is_planting(farming_cell_dto: farming_cell_dto, farming_cell_action_dto: farming_cell_action_dto): boolean
Link copied to clipboard
function is_watering(farming_cell_action_dto: farming_cell_action_dto): boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
function measure_max_x(locations: list<location>): integer
Link copied to clipboard
function merge_crops(plot_id: integer, just_planted_cells: list<location>, cells_map: map<location, farming_cell_dto>)
Link copied to clipboard
function merge_crops_nop(just_planted_cells: list<location>, cells_map: map<location, farming_cell_dto>): list<location>
Link copied to clipboard
function merge_crops_random(just_planted_cells: list<location>, cells_map: map<location, farming_cell_dto>): list<location>
Link copied to clipboard
@extend(on_renter_removed) function on_renter_removed_cleanup(account_id: byte_array, plot_id: integer)
Link copied to clipboard
@extend(on_sharee_removed) function on_sharee_removed_cleanup(account_id: byte_array, plot_id: integer)
Link copied to clipboard
function persist_blocks(plot_id: integer, cells: list<farming_cell_dto>)
Link copied to clipboard
function plant_on_cell(account_id: byte_array, farming_cell_dto: farming_cell_dto, farming_cell_action_dto: farming_cell_action_dto, assets_to_charge: map<text, integer>, seeds_map: map<text, seed_type>, transformations_map: map<text, list<text>>, action_index: integer, timestamp: integer)
Link copied to clipboard
Link copied to clipboard
function process_merged_crops(farming_plot_action_dto: farming_plot_action_dto, cells_map: map<location, farming_cell_dto>, seeds_map: map<text, seed_type>, rewards: map<item, integer>)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
function register_seed(seed_name: text, produce_id: text, growing_cycles: integer, harvest_amount: integer, fertility_extra_produce: integer, merged_crop_extra_produce: integer, planting_durability_cost: integer, watering_durability_cost: integer, harvesting_durability_cost: integer, time_per_growth_cycle: integer)
Link copied to clipboard
function require_not_harvesting_yet(farming_cell_action_dto: farming_cell_action_dto)
Link copied to clipboard
Link copied to clipboard
function require_produce_id_exist(produce_id: text)
Link copied to clipboard
function sing_on_cell(plant: plant_dto, current_cell: location, cell: location, divided_area: integer): boolean
Link copied to clipboard
function sing_on_plot_with_time(plot_id: integer, current_cell: location, flute: text, account_id: byte_array, auth_descriptor_id: byte_array, current_time: integer)
Link copied to clipboard
function unmerge_crop(removed_cell: farming_cell_dto, cells_map: map<location, farming_cell_dto>, just_planted_cells: list<farming_cell_dto>)
Link copied to clipboard
function update_planted_cell(account_id: byte_array, plot_id: integer, cell: farming_cell_dto, farming_cell_action_dto: farming_cell_action_dto, seed_type: seed_type, rewards: map<item, integer>, cells_map: map<location, farming_cell_dto>, just_planted_cells: list<farming_cell_dto>, possible_seed_rewards: set<text>, action_index: integer, timestamp: integer, plot_seed_ownerships: list<seed_ownership>)
Link copied to clipboard
function update_state_for_batch(farming_plot_action_dto: farming_plot_action_dto, player: player, timestamp: integer, fertility_rate: integer)
Link copied to clipboard
function update_state_for_cell(farming_cell_action_dto: farming_cell_action_dto, player: player, assets_to_charge: map<text, integer>, rewards: map<item, integer>, cells_map: map<location, farming_cell_dto>, seeds_map: map<text, seed_type>, transformations_map: map<text, list<text>>, possible_seed_rewards: set<text>, action_index: integer, timestamp: integer, epoch_days: integer, plot_id: integer, fertility_rate: integer, just_planted_cells: list<farming_cell_dto>, plot_seed_ownerships: list<seed_ownership>)
Link copied to clipboard
function update_state_with_time(farming_plot_action_dto: farming_plot_action_dto, account_id: byte_array, auth_descriptor_id: byte_array, timestamp: integer)
Link copied to clipboard
function update_watered_cells(account_id: byte_array, cells: list<(farming_cell_dto, farming_cell_action_dto)>, seeds_map: map<text, seed_type>, timestamp: integer)
Link copied to clipboard
function update_watered_plants(account_id: byte_array, plot_id: integer, current_time: integer, cell_actions: list<farming_cell_action_dto>)
Link copied to clipboard
function validate_sent_seeds(farming_plot_action_dto: farming_plot_action_dto)

Queries

Link copied to clipboard
@mount("farming.get_all_seed_types") query get_all_seed_types(): list<seed_type_dto>
Link copied to clipboard
@mount("farming.get_all_seeds") query get_all_seeds(): list<seed_dto>
Link copied to clipboard
@mount("farming.get_farming_configs") query get_farming_configs(): (enabled: boolean, grace_period_in_millis: integer, fertility_decision_strategy: fertility_decision_strategy, merge_list_strategy: merge_list_strategy, singing_area: integer, singing_cycle_in_millis: integer, singing_limit_by_day: integer, singing_limit_by_plot: integer, singing_durability_cost: integer, tilling_durability_cost: integer)
Link copied to clipboard
@mount("farming.get_recent_produce") query get_recent_produce(account_id: byte_array): list<(name: text, type: text, amount: integer)>
Link copied to clipboard
@mount("farming.get_sung_amount_in_cycle") query get_sung_amount_in_cycle(account_id: byte_array): integer
Link copied to clipboard
@mount("farming.get_sung_on_plot_in_cycle") query get_sung_on_plot_in_cycle(account_id: byte_array, plot_id: integer): integer
Link copied to clipboard
@mount("farming.state_at_locations") query state_at_locations(plot_id: integer, locations: list<location>): list<farming_cell_dto>
Link copied to clipboard
@mount("farming.state_at_plot") query state_at_plot(plot_id: integer): list<farming_cell_dto>
Link copied to clipboard
@mount("farming.state_at_plot_on") query state_at_plot_on(plot_id: integer, timestamp: integer): list<farming_cell_dto>

Operations

Link copied to clipboard
@mount("farming.register_crop") operation register_crop(name: text)
Link copied to clipboard
@mount("farming.register_seed_transformation") operation register_seed_transformation(initial: text, results: list<text>)
Link copied to clipboard
@mount("farming.register_seed_type") operation register_seed_type(seed_name: text, produce_id: text, growing_cycles: integer, harvest_amount: integer, fertility_extra_produce: integer, merged_crop_extra_produce: integer, planting_durability_cost: integer, watering_durability_cost: integer, harvesting_durability_cost: integer, price: integer, time_per_growth_cycle: integer)
Link copied to clipboard
@mount("farming.revert_plants_in_plot") operation revert_plants_in_plot(plot_id: integer)
Link copied to clipboard
@mount("farming.set_global_farming_parameters") operation set_global_farming_parameters(enabled: boolean, grace_period_in_millis: integer)
Link copied to clipboard
@mount("farming.set_global_singing_parameters") operation set_global_singing_parameters(singing_cycle_in_millis: integer, singing_area: integer, singing_limit_by_day: integer, singing_limit_by_plot: integer)
Link copied to clipboard
@mount("farming.set_singing_durability_cost") operation set_singing_durability_cost(durability_cost: integer)
Link copied to clipboard
@mount("farming.set_tilling_durability_cost") operation set_tilling_durability_cost(durability_cost: integer)
Link copied to clipboard
@mount("farming.sing") operation sing(plot_id: integer, cell: location, flute: text, account_id: byte_array, auth_descriptor_id: byte_array)
Link copied to clipboard
@mount("farming.update_seed_type") operation update_seed_type(seed_name: text, produce_id: text, growing_cycles: integer, harvest_amount: integer, fertility_extra_produce: integer, merged_crop_extra_produce: integer, planting_durability_cost: integer, watering_durability_cost: integer, harvesting_durability_cost: integer, time_per_growth_cycle: integer)
Link copied to clipboard
@mount("farming.update_state") operation update_state(farming_plot_action_dto: farming_plot_action_dto, account_id: byte_array, auth_descriptor_id: byte_array)